#ifndef _UIBUTTON_H
#define _UIBUTTON_H

#include <GL/glew.h>

#include "GameInfo.h"
#include "UIControl.h"
#include "Colour.h"
#include "Shader.h"
#include "Matrix4.h"
#include "Vector2.h"
#include "Vector3.h"
#include "Input.h"
#include "ResourceManager.h"
#include "Delegate.h"
#include "Event.h"
#include "EventData.h"
#include "Texture.h"

#ifdef GALLIUMENGINE_DLL 
#define GALLIUMENGINE_API __declspec( dllexport )
#else
#define GALLIUMENGINE_API __declspec( dllimport )
#endif

namespace GalliumEngine
{

	class UIButton : public UIControl
	{
	private:
		Texture* upTexture;
		Texture* clickTexture;
		Texture* hoverTexture;
		bool isHover;
		bool isClick;
		bool isEnabled;
		bool sticksDown;
	public:
		GALLIUMENGINE_API UIButton(void);

		GALLIUMENGINE_API UIButton(std::string _id);

		GALLIUMENGINE_API ~UIButton(void);

		GALLIUMENGINE_API virtual void bind();

		GALLIUMENGINE_API virtual void initialize(std::string _upTexture,
			std::string _clickTexture,
			std::string _hoverTexture,
			Vector2 _position,
			Vector2 _size,
			int _depth,
			std::string shaderId,
			std::string _vertexShader,
			std::string _fragmentShader);

		GALLIUMENGINE_API virtual void deinitialize();

		GALLIUMENGINE_API void setEnabled(bool _enabled);

		GALLIUMENGINE_API void setSticksDown(bool _sticksDown);

		GALLIUMENGINE_API virtual void update(float delta);
		GALLIUMENGINE_API virtual void draw();

		 Event<EventData> OnClick;
		 Event<EventData> OnEnter;
		 Event<EventData> OnLeave;
		 Event<EventData> OnRelease;
	};

}

#endif

